Skip to content

NetApp: create CS volume and template from CS volume snapshot - #14517

Open
rajiv-jain-netapp wants to merge 5 commits into
apache:mainfrom
NetApp:feature/CSTACKEX-306-create-from-snapshot
Open

rajiv-jain-netapp wants to merge 5 commits into
apache:mainfrom
NetApp:feature/CSTACKEX-306-create-from-snapshot

Conversation

@rajiv-jain-netapp

@rajiv-jain-netapp rajiv-jain-netapp commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR...

  1. Enable user to create cloudstack volume from the cloudstack-volume-snapshot which is expected to get persisted in the same primary storage pool.
  2. Enable user to create template from the cloudstack-volume-snapshot and get it persisted in the secondary storage.

Behaviour:

  1. Created CS volume would always be of type DATA. Even from the ROOT cloudstack-volume-snapshot, user can create DATA type of CS-volume.
  2. User can create and attach or only create the CS-volume from the CS-volume-snapshot.
  3. User can use create template option from the CS-volume-snapshot if user wants to create template.
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

  • First created the CS-volume-snapshots
image
  • created data type of volume from the snapshot as below
image
  • then created CS-volume and also attaching the same in the same request, with the existing VM
image image
  • create template from the snapshot
image image

rajiv-jain-netapp and others added 4 commits September 24, 2026 20:34
Enable the managed-storage template cache flow for the ONTAP primary
storage plugin so that VM root volumes are cloned from a template copy
kept on the pool's FlexVolume instead of being copied from secondary
storage for every deployment.

- Advertise CAN_CREATE_VOLUME_FROM_VOLUME from the datastore driver.
- Create the template cache on primary: an iSCSI LUN (identity tracked on
  template_spool_ref) or a qcow2 file for NFS, populated by the KVM host.
- Clone new volumes from the cached template: LUN clone for iSCSI and
  ONTAP file clone (FileCloneRequest) for NFS, growing the clone when the
  disk offering is larger than the template.
- Clean up the cached LUN/file when the template is removed from the pool;
  a missing file is treated as already deleted.
- Move protocol-specific create/clone/resize logic into
  UnifiedSANStrategy and UnifiedNASStrategy, and add a StorageStrategy
  helper to poll an optional async job.
- Add unit tests for the driver and the NAS/SAN strategies.
Stack the snapshot-clone paths onto the ONTAP template-cache branch so a
volume or template can be created from a CloudStack volume snapshot that
already lives on the same primary pool.

- Clone a data volume from a snapshot on the same FlexVolume (iSCSI LUN
  clone or NFS file clone). A root snapshot still produces a data volume;
  the bootable path is create-template-from-snapshot.
- Copy a snapshot into a temporary volume when creating a template, then
  remove that temporary volume record after the copy.
- Grow the clone when the disk offering is larger than the snapshot, and
  delete the orphaned clone if resize fails.
- Keep template-cache behavior for clone-from-template, including the
  existing pool types (Iscsi and NetworkFilesystem) on this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant